package commons_io;

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;

import java.io.File;
import java.io.IOException;

public class Demo1 {
    public static void main(String[] args) throws IOException {
        //jar包commons-io的实例
        //1.复制文件
        FileUtils.copyFile(new File("IODemo\\a.txt"),new File("IODemo\\b.txt"));
        //2.复制文件夹
        File src = new File("D:\\temp\\Jack");
        File dest = new File("D:\\temp\\liuhe");
        FileUtils.copyDirectory(src,dest);
        //3.复制文件夹到一个文件夹中
        FileUtils.copyDirectoryToDirectory(src,dest);

    }
}
